<div class="cart-display">
	<h2 class="smart"><?php echo $this->__('Shopping Cart');?></h2>
	<?php App::Component('appStore')->Helper('Data')->renderShoppingCart();?>
</div>
<?php
		echo App::Helper("Javascript")
				->validation_map(
								  Array(
										  '_errBg'=>ERROR_BACKGROUND,
										  '_dflBg'=>'#CFCFCF',
										  '_autoSubmit'=>'false',
										  '_errorMark'=>'inline',
										  '_errToolTips'=>'false'
										)
								 );
		echo App::Helper("Javascript")
				->ajax_submit(
								Array(
										 "form_name"=>"#post-checkout",
										 "debug"=>"true",
										 "auto_hide"=>"true",
										 "message_element"=>".message"
									 )
							 );
?>
<div class="checkout">
	<form method="post" class="app_form app_validation" id="post-checkout" action="<?php echo $this->baseurl("/appstore/completeCheckout") ?>">
	<div class="c-left">

		<div class="app-tab">
			<ul class="app-tab-head">
				<li class="tab tab-selected"><a href="javascript:void(0)">Billing Address</a></li>
				<li class="tab"><a href="javascript:void(0)">Shipping Address</a></li>
			</ul>
			<ul class="app-tab-pan">
				<li><?php
					App::Module("DataGrid")->clear()
										   ->setDisplay('FormListing')
										   ->addRow($this->__("First Name"),App::Load("Helper/Html")->inputTag("data[Billing][fname]","",array("class"=>"input-small check_notdefault",'id'=>'f_name','longdesc'=>'Please enter your first name')) )
										   ->addRow($this->__("Last Name"),App::Load("Helper/Html")->inputTag("data[Billing][lname]","",array("class"=>"input-small check_notdefault",'id'=>'l_name','longdesc'=>'Please enter your last name')) )
										   ->addRow($this->__("Address line 1"),App::Load("Helper/Html")->inputTag("data[Billing][address_line_1]","",array("class"=>"input-small check_notdefault",'id'=>'address_line_1','longdesc'=>'Please enter your address line 1')) )
										   ->addRow($this->__("Address line 2"),App::Load("Helper/Html")->inputTag("data[Billing][address_line_2]","",array("class"=>"input-small",'id'=>'address_line_2')) )
										   ->addRow($this->__("City/Town"),App::Load("Helper/Html")->inputTag("data[Billing][city]","",array("class"=>"input-small check_notdefault",'id'=>'city','longdesc'=>'Please enter your city/town name')) )
										   ->addRow($this->__("State/Province"),App::Load("Helper/Html")->inputTag("data[Billing][state]","",array("class"=>"input-small check_notdefault",'id'=>'state','longdesc'=>'Please enter your State/Province name')) )
										   ->addRow($this->__("Postal/Zip Code"),App::Load("Helper/Html")->inputTag("data[Billing][zipcode]","",array("class"=>"input-small check_notdefault",'id'=>'zipcode','longdesc'=>'Please enter your Postal/Zip Code')) )
										   ->addRow($this->__("Country"), App::Load("Helper/Html")->countryTag("data[Billing][country]","US",array("id" => "country","class"=>"select check_notempty",'longdesc'=>'Please select your country')) )
										   ->addRow($this->__("Email"),App::Load("Helper/Html")->inputTag("data[Billing][email]","",array("class"=>"input-small check_email",'id'=>'email')) )
										   ->Render();
				?>
				</li>
				<li><?php
					App::Module("DataGrid")->clear()
										   ->setDisplay('FormListing')
										   ->addRow($this->__("First Name"),App::Load("Helper/Html")->inputTag("data[Shipping][fname]","",array("class"=>"input-small check_notdefault",'id'=>'f_name','longdesc'=>'Please enter your first name')) )
										   ->addRow($this->__("Last Name"),App::Load("Helper/Html")->inputTag("data[Shipping][lname]","",array("class"=>"input-small check_notdefault",'id'=>'l_name','longdesc'=>'Please enter your last name')) )
										   ->addRow($this->__("Address line 1"),App::Load("Helper/Html")->inputTag("data[Shipping][address_line_1]","",array("class"=>"input-small check_notdefault",'id'=>'address_line_1','longdesc'=>'Please enter your address line 1')) )
										   ->addRow($this->__("Address line 2"),App::Load("Helper/Html")->inputTag("data[Shipping][address_line_2]","",array("class"=>"input-small",'id'=>'address_line_2')) )
										   ->addRow($this->__("City/Town"),App::Load("Helper/Html")->inputTag("data[Shipping][city]","",array("class"=>"input-small check_notdefault",'id'=>'city','longdesc'=>'Please enter your city/town name')) )
										   ->addRow($this->__("State/Province"),App::Load("Helper/Html")->inputTag("data[Shipping][state]","",array("class"=>"input-small check_notdefault",'id'=>'state','longdesc'=>'Please enter your State/Province name')) )
										   ->addRow($this->__("Postal/Zip Code"),App::Load("Helper/Html")->inputTag("data[Shipping][zipcode]","",array("class"=>"input-small check_notdefault",'id'=>'zipcode','longdesc'=>'Please enter your Postal/Zip Code')) )
										   ->addRow($this->__("Country"), App::Load("Helper/Html")->countryTag("data[Shipping][country]","US",array("id" => "country","class"=>"select check_notempty",'longdesc'=>'Please select your country')) )
										   ->addRow($this->__("Email"),App::Load("Helper/Html")->inputTag("data[Shipping][email]","",array("class"=>"input-small check_email",'id'=>'email')))
										   ->Render();
				?></li>
			</ul>
			<div style="padding:10px;margin:5px 0;background:#D9E5EE">
				<input name="data[Checkout][shiptobillingaddress]" id="shiptobillingaddress" type="checkbox" value="Yes" /> Ship in same billing address</div>
		</div>

	</div>
	<div class="c-right">
		<h2 class="smart"><?php echo $this->__("Payment Method");?></h2>
		<p><div class="inner message"></div></p>
		<p><?php echo $this->__("Select a payment method");?></p>
		<div class="inner"><?php echo App::Component('appStore')->Helper('Pgateway_Render')->renderPaymentMethods();?></div>
		<p><input type="submit" value="Continue Checkout" name="data[Payment][submit]" class="button" /></p>
	</div>
	</form>
</div>